<!-- *Author: 黄旗, *Date: 2020-08-04 15:45:59 -->
<template>
    <Card :bordered="false" dis-hover>
        <Form>
            <Row :gutter='24' type='flex' class='ivu-mb-16'>
                <Col>
                <Button type='primary' @click='openedit(-1)'>新增</Button>
                </Col>
            </Row>
        </Form>
        <div class='i-table-no-border'>
            <Table highlight-row ref='table' :columns='columns' :loading='loading' :data='data'>
                <template slot-scope='{row}' slot='info'>
                    <a href='javaScript:;' @click='openedit(row)'>编辑</a>
                    <a href='javaScript:;' @click='deleteedit(row)'>删除</a>
                </template>
            </Table>
            <div class='ivu-mt ivu-text-center'>
                <Page show-total show-elevator show-sizer :total='total' :current.sync='params.page'
                    :page-size='params.pageSize' :page-size-opts='pageOpts' @on-change='changepage'
                    @on-page-size-change='changepageSize' />
            </div>
            <Modal v-model='modal' :title='edit?`编辑`:`新增`' :mask-closable='false' @on-cancel='canceledit(modalname)'>
                <Form :label-width='80' :ref='modalname' :model='formItem' :rules='createRules'>
                    <FormItem label='名称' prop='name'>
                        <Input clearable v-model='formItem.name' placeholder='请输入名称' />
                    </FormItem>
                </Form>
                <div slot='footer'>
                    <Button @click='canceledit(modalname)'>取消</Button>
                    <Button type='primary' @click='submitedit(modalname)'>确定</Button>
                </div>
            </Modal>
        </div>
    </Card>
</template>

<script>
    import mixins from '@/mixins/mixins';
    import power from '@/mixins/power';
    /* 多余属性注释请删除 */
    export default {
        name: '',
        mixins: [mixins, power],
        components: {},
        porp: [],
        data() {
            return {
                powereditlist: [{ key: 1, name: '设备管理新增' }, { key: 2, name: '设备管理绑定' }, { key: 3, name: '设备管理修改' }, { key: 4, name: '设备管理删除' }],
                params: { page: 1, pageSize: 20 } // 请求参数
            };
        },
        /* 函数方法集合 */
        methods: {
            /* @函数功能: 初始化 */
            initial() {
                this.funaskData = ''
                this.funupdate = ''
                this.funcreate = ''
                this.funupdate = ''
                this.askData()
            },
            askDatas(res) {
                this.poweredit(this.powereditlist)
            }, // 请求数据处理
            searchparams() { }, // 搜索数据处理
            paramscancel() { }, // 新增编辑取消数据处理
            paramsedit() { }, // 新增编辑显示数据处理
            paramssubmit() { } // 新增编辑提交数据处理
        }
    }
</script>